import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import { mode, modeType } from '@/utils/dicts'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: `/${mode}`
  },
  {
    path: `/${modeType.TEACHER}`, // 教师端登录
    component: () => import('@/views/login/teacher.vue')
  },
  {
    path: '/room', // room
    component: () => import('@/views/room/index.vue')
  },
  {
    path: `/${modeType.STUDENT}`, // 学员端登录
    component: () => import('@/views/login/student.vue')
  },
  {
    path: '/studentHome', // 学员首页
    component: () => import('@/views/student/index.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
